package com.tjshop.android.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.tjshop.android.R;

import java.util.List;

/**
 * Created by GuangYin on 2014-12-28.
 */
public class allCity_adapter extends BaseAdapter {
	private LayoutInflater inflater;
	List<String> cityList;

	public allCity_adapter(List<String> clist, LayoutInflater inflater) {
		this.inflater = inflater;
		cityList = clist;
	}

	@Override
	public int getCount() {
		return cityList.size();
	}

	@Override
	public Object getItem(int i) {
		return cityList.get(i);
	}

	@Override
	public long getItemId(int i) {
		return i;
	}

	@Override
	public View getView(int i, View view, ViewGroup viewGroup) {
		view = inflater.inflate(R.layout.inc_common_listview_item, null);
		TextView city = (TextView) view.findViewById(R.id.textContent);
		city.setText(cityList.get(i));
		return view;
	}
}
